﻿using Mohe.Scada.Util.Models;

namespace IPlugin
{
    /// <summary>
    /// 返回结果模型
    /// </summary>
    public class DriverReturnValueModel
    {
        public DriverReturnValueModel()
        {
            this.Timestamp = DateTime.Now;
        }

        public DriverReturnValueModel(EnumVariableStatus status)
        {
            this.Timestamp = DateTime.Now; ;
            StatusType = status;
        }
        public DriverReturnValueModel(EnumVariableStatus status, string message)
        {
            this.Timestamp = DateTime.Now;
            StatusType = status;
            this.Message = message;
        }
        /// <summary>
        /// 原始值
        /// </summary>
        public object Value { get; set; }
        /// <summary>
        /// 转换后值
        /// </summary>
        public object CookedValue { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 时间戳
        /// </summary>
        public DateTime Timestamp { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public EnumVariableStatus StatusType { get; set; } = EnumVariableStatus.Unknow;
        /// <summary>
        /// 变量ID
        /// </summary>
        public int VarId { get; set; }
    }
}
